# coding=utf-8
import datetime


def configure_template_filters(app):
    @app.template_filter()
    def add_days(time_str, days, fmt='%Y-%m-%d'):
        date = datetime.datetime.strptime(time_str, fmt)
        date = date + datetime.timedelta(days=days)
        return date